package com.bing.springboot.utils;

import javax.servlet.http.HttpServletRequest;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * @author 徐
 * @version 1.0
 */
public class WebUtils {


    //定义一个文件上传的路径
    public static String  UPLOAD_FILE_DIRECTORY = "static/images/upload/";
    //定义文件所在本地磁盘目录
    //public static String  HEAD_IMG_DIRECTORY = "E:\\work_space_idea\\hsp_javaweb\\jiaju_mall\\out\\artifacts\\jiaju_mall_war_exploded\\";


    /**
     * 得到一个表示当前日期的字符串
     * 2023/4/11
     * 作为文件上传路径
     * @return
     */
    public static String getUploadFileDirectory() {
        return UPLOAD_FILE_DIRECTORY + new SimpleDateFormat("yyyy/MM/dd").format(new Date());
    }
}
